<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('user_ranks', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('user_id')->comment('店员ID');
            $table->bigInteger('store_id')->comment('门店ID');
            $table->decimal('total_money')->default(0)->comment('总消费');
            $table->decimal('total_table_money')->default(0)->comment('总桌费');
            $table->decimal('total_goods_money')->default(0)->comment('总商品费');
            $table->decimal('total_assistant_money')->default(0)->comment('总陪打费');
            $table->integer('total_services_point')->default(0)->comment('总服务积分');
            $table->integer('total_point')->default(0)->comment('总积分');
            $table->date('count_date')->comment('统计日期');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('assistant_ranks');
    }
};
